package com.excilys.blog.refactoring.refactored;

import com.excilys.blog.refactoring.GeoPoint;

class EastPositionDelta extends PositionDelta {

    public EastPositionDelta(GeoPoint firstPoint, GeoPoint secondPoint) {
        super(firstPoint, secondPoint);
    }

    @Override
    protected boolean isInGoodDirection() {
        return isPointEasterOrSameButSouther();
    }

    private boolean isPointEasterOrSameButSouther() {
        return longitudeDelta > 0 || longitudeDelta == 0 && latitudeDelta < 0;
    }

}
